package com.ucarbon.ucarbon.service.impl;

import com.ucarbon.ucarbon.entity.Years;
import com.ucarbon.ucarbon.mapper.YearsMapper;
import com.ucarbon.ucarbon.service.IYearsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 年份信息 服务实现类
 * </p>
 *
 * @author XuGaoran
 * @since 2024-01-04
 */
@Service
public class YearsServiceImpl extends ServiceImpl<YearsMapper, Years> implements IYearsService {

    @Autowired
    private YearsMapper yearsMapper;

    @Override
    public Boolean hasYear(Integer year) {
        return yearsMapper.exists(new QueryWrapper<Years>().eq("year_num", year));
    }

}
